from sai import Pipeline, Item


class StripPipeline(Pipeline):

    def process_item(self, item: Item, spider) -> Item:
        for k, v in item.items():
            if isinstance(v, str):
                item[k] = v.strip()
        return item
